home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / pupworld.swf / scripts / __Packages / Heroes / Score.as < prev    next >
Encoding:
Text File  |  2011-06-09  |  775 b   |  35 lines

  1. class Heroes.Score extends MovieClip
  2. {
  3.    var currentScore_lz;
  4.    var currentScore = 0;
  5.    var frameCounter = 0;
  6.    function Score()
  7.    {
  8.       super();
  9.       this.setScore(Heroes.Tools.getScore());
  10.    }
  11.    function onEnterFrame()
  12.    {
  13.       this.frameCounter = this.frameCounter + 1;
  14.       if(this.frameCounter == 2)
  15.       {
  16.          this.setScore(this.currentScore);
  17.       }
  18.    }
  19.    function addScore(extraScore)
  20.    {
  21.       this.currentScore += extraScore;
  22.       this.currentScore_lz.setNumber(this.currentScore);
  23.       this.play();
  24.    }
  25.    function setScore(newScore)
  26.    {
  27.       this.currentScore = newScore;
  28.       this.currentScore_lz.setNumber(this.currentScore);
  29.    }
  30.    function getScore()
  31.    {
  32.       return this.currentScore;
  33.    }
  34. }
  35.